<?php
namespace app\cdyoa\controller;
use think\Db;
class Shenhe extends Base
{
    public function tshou(){
        if(is_post()){
            $d = [
                'id' => input('id'),
                'action_user_id' => $this->userinfo['id'],
                'action_note' => input('pass'),
                'status' => 2,
                'update_time' => time(),
            ];
            Db::name('in_shou')->update($d);
            $config = [
                'suc' => [
                    'msg' => '审核通过成功！',
                    'js_action' => 'alert|reload',
                ],
            ];
            com_check($config);
        }
    }
    public function bshou(){
        if(is_post()){
            $d = [
                'id' => input('id'),
                'action_user_id' => $this->userinfo['id'],
                'action_note' => input('pass'),
                'status' => 1,
                'update_time' => time(),
            ];
            Db::name('in_shou')->update($d);
            $config = [
                'suc' => [
                    'msg' => '审核驳回成功！',
                    'js_action' => 'alert|reload',
                ],
            ];
            com_check($config);
        }
    }
    public function ttui(){
        if(is_post()){
            $d = [
                'id' => input('id'),
                'action_user_id' => $this->userinfo['id'],
                'action_note' => input('pass'),
                'status' => 1,
                'update_time' => time(),
            ];
            Db::name('in_tui')->update($d);
            $config = [
                'suc' => [
                    'msg' => '审核通过成功！',
                    'js_action' => 'alert|reload',
                ],
            ];
            com_check($config);
        }
    }
    public function btui(){
        if(is_post()){
            $d = [
                'id' => input('id'),
                'action_user_id' => $this->userinfo['id'],
                'action_note' => input('pass'),
                'status' => 2,
                'update_time' => time(),
            ];
            Db::name('in_tui')->update($d);
            $config = [
                'suc' => [
                    'msg' => '审核驳回成功！',
                    'js_action' => 'alert|reload',
                ],
            ];
            com_check($config);
        }
    }
    public function tzc(){
        if(is_post()){
            $d = [
                'id' => input('id'),
                'action_user_id' => $this->userinfo['id'],
                'action_note' => input('pass'),
                'status' => 1,
                'update_time' => time(),
            ];
            Db::name('out_zc')->update($d);
            $config = [
                'suc' => [
                    'msg' => '审核通过成功！',
                    'js_action' => 'alert|reload',
                ],
            ];
            com_check($config);
        }
    }
    public function bzc(){
        if(is_post()){
            $d = [
                'id' => input('id'),
                'action_user_id' => $this->userinfo['id'],
                'action_note' => input('pass'),
                'status' => 2,
                'update_time' => time(),
            ];
            Db::name('out_zc')->update($d);
            $config = [
                'suc' => [
                    'msg' => '审核驳回成功！',
                    'js_action' => 'alert|reload',
                ],
            ];
            com_check($config);
        }
    }
    
    //审核订单
    public function orders($id=''){
        if(is_post()){
            $d = [
                'status' => input('status'),
                'action_user_id' => $this->userinfo['id'],
                'action_note' => input('note'),
                'id' => $id,
                'update_time' => time(),
            ];
            Db::name('orders')->update($d);
            com_check(['suc'=>['msg'=>'更新成功！' ,'js_action'=>'alert|close']]);
        }
        $d = [
            'info' => Db::name('orders')->find($id),
            'orders_status' => c('type.orders_status'),
            'id' => $id,
        ];
        return view('',$d);
    }
}
